﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.IO;

namespace WPFRadio
{

    [Serializable]
    [System.Xml.Serialization.XmlRoot()]
    public class Radio
    {

          public int Id { get; set; }
          public string name { get; set; }
          public string genre { get; set; }
          public string Base {get; set;}
          public string MediaType { get; set; }
          public string BitRate { get; set; }
          public string comment { get; set; }


        public Radio()
          {

          }
        

          
      
        


    }

    [Serializable]
    [System.Xml.Serialization.XmlRoot()]
    public class RadioList
    {
        private List<Radio> m_radioList;

        [System.Xml.Serialization.XmlArray("Liste")]
        public List<Radio> PL
        {
            get { return m_radioList; }
            set {m_radioList = value;}
        }
        public RadioList()
        {}
        
        public static RadioList Deserialize(Stream  stream)
        {
            System.Xml.Serialization.XmlSerializer Serialiser;

            Serialiser = new System.Xml.Serialization.XmlSerializer(typeof(RadioList));
            object obj = Serialiser.Deserialize(stream);
            if (obj != null && obj is RadioList)
                return obj as RadioList;
            else
                return null;
            
            
        }




    }

    
}
